# Presentation层 - 现代QML表现层
cmake_minimum_required(VERSION 3.16)

# 收集C++源文件
file(GLOB_RECURSE PRESENTATION_SOURCES "*.cpp")
file(GLOB_RECURSE PRESENTATION_HEADERS "*.h")

# 自动扫描QML文件
file(GLOB_RECURSE QML_FILES "qml/*.qml")
file(GLOB_RECURSE QMLDIR_FILES "qml/*/qmldir")

# 创建presentation库
add_library(presentation STATIC
    ${PRESENTATION_SOURCES}
    ${PRESENTATION_HEADERS}
)

# 自动添加所有QML文件到资源
qt6_add_resources(presentation "qml_resources"
    PREFIX "/qml"
    BASE "${CMAKE_CURRENT_SOURCE_DIR}/qml"
    FILES
        ${QML_FILES}
        ${QMLDIR_FILES}
)

# presentation层依赖application层 (NOT infrastructure - Clean Architecture compliance)
target_link_libraries(presentation PUBLIC
    application
    Qt6::Core
    Qt6::Gui    # Required for QColor and QPainter in custom items
    Qt6::Quick
    Qt6::QuickControls2
)

# 包含目录
target_include_directories(presentation PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_SOURCE_DIR}/src
)
